#!/bin/bash
# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other
# HYPRE Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)

#=============================================================================
# ij_mm: SpGEMM GPU benchmarks
#=============================================================================

# A^2

mpirun -np 1 ./ij_mm -n 128 128 128  -7pt -verify 1 -spgemm_binned 0 -spgemmalg 1 -rep 10 > benchmark_spgemm.out.1
mpirun -np 1 ./ij_mm -n 128 128 128 -27pt -verify 1 -spgemm_binned 0 -spgemmalg 1 -rep 10 > benchmark_spgemm.out.2
mpirun -np 1 ./ij_mm -n 1024 1024 1  -5pt -verify 1 -spgemm_binned 0 -spgemmalg 1 -rep 10 > benchmark_spgemm.out.3
mpirun -np 1 ./ij_mm -n 1024 1024 1  -9pt -verify 1 -spgemm_binned 0 -spgemmalg 1 -rep 10 > benchmark_spgemm.out.4

mpirun -np 1 ./ij_mm -n 128 128 128  -7pt -verify 1 -spgemm_binned 1 -spgemmalg 1 -rep 10 > benchmark_spgemm.out.5
mpirun -np 1 ./ij_mm -n 128 128 128 -27pt -verify 1 -spgemm_binned 1 -spgemmalg 1 -rep 10 > benchmark_spgemm.out.6
mpirun -np 1 ./ij_mm -n 1024 1024 1  -5pt -verify 1 -spgemm_binned 1 -spgemmalg 1 -rep 10 > benchmark_spgemm.out.7
mpirun -np 1 ./ij_mm -n 1024 1024 1  -9pt -verify 1 -spgemm_binned 1 -spgemmalg 1 -rep 10 > benchmark_spgemm.out.8

mpirun -np 1 ./ij_mm -n 128 128 128  -7pt -verify 1 -spgemm_binned 0 -spgemmalg 3 -rep 10 > benchmark_spgemm.out.9
mpirun -np 1 ./ij_mm -n 128 128 128 -27pt -verify 1 -spgemm_binned 0 -spgemmalg 3 -rep 10 > benchmark_spgemm.out.10
mpirun -np 1 ./ij_mm -n 1024 1024 1  -5pt -verify 1 -spgemm_binned 0 -spgemmalg 3 -rep 10 > benchmark_spgemm.out.11
mpirun -np 1 ./ij_mm -n 1024 1024 1  -9pt -verify 1 -spgemm_binned 0 -spgemmalg 3 -rep 10 > benchmark_spgemm.out.12

mpirun -np 1 ./ij_mm -n 128 128 128  -7pt -verify 1 -vendor 1                     -rep 10 > benchmark_spgemm.out.13
mpirun -np 1 ./ij_mm -n 80   80  80 -27pt -verify 1 -vendor 1                     -rep 10 > benchmark_spgemm.out.14
mpirun -np 1 ./ij_mm -n 1024 1024 1  -5pt -verify 1 -vendor 1                     -rep 10 > benchmark_spgemm.out.15
mpirun -np 1 ./ij_mm -n 1024 1024 1  -9pt -verify 1 -vendor 1                     -rep 10 > benchmark_spgemm.out.16

# Diag(A) * A

mpirun -np 1 ./ij_mm -n 128 128 128  -7pt -verify 1 -spgemm_binned 1 -spgemmalg 1 -job 5 -rep 10 > benchmark_spgemm.out.17
mpirun -np 1 ./ij_mm -n 128 128 128 -27pt -verify 1 -spgemm_binned 1 -spgemmalg 1 -job 5 -rep 10 > benchmark_spgemm.out.18
mpirun -np 1 ./ij_mm -n 1024 1024 1  -5pt -verify 1 -spgemm_binned 1 -spgemmalg 1 -job 5 -rep 10 > benchmark_spgemm.out.19
mpirun -np 1 ./ij_mm -n 1024 1024 1  -9pt -verify 1 -spgemm_binned 1 -spgemmalg 1 -job 5 -rep 10 > benchmark_spgemm.out.20

# A^2

mpirun -np 4 ./ij_mm -n 256 256 128 -P 2 2 1  -7pt -verify 1 -rep 10 > benchmark_spgemm.out.21
mpirun -np 4 ./ij_mm -n 256 256 128 -P 2 2 1 -27pt -verify 1 -rep 10 > benchmark_spgemm.out.22
mpirun -np 4 ./ij_mm -n 2048 2048 1 -P 2 2 1  -5pt -verify 1 -rep 10 > benchmark_spgemm.out.23
mpirun -np 4 ./ij_mm -n 2048 2048 1 -P 2 2 1  -9pt -verify 1 -rep 10 > benchmark_spgemm.out.24

# A^T * A

mpirun -np 4 ./ij_mm -n 256 256 128 -P 2 2 1  -7pt -verify 1 -rep 10 -job 2 > benchmark_spgemm.out.25
mpirun -np 4 ./ij_mm -n 256 256 128 -P 2 2 1 -27pt -verify 1 -rep 10 -job 2 > benchmark_spgemm.out.26
mpirun -np 4 ./ij_mm -n 2048 2048 1 -P 2 2 1  -5pt -verify 1 -rep 10 -job 2 > benchmark_spgemm.out.27
mpirun -np 4 ./ij_mm -n 2048 2048 1 -P 2 2 1  -9pt -verify 1 -rep 10 -job 2 > benchmark_spgemm.out.28

# P^T*A*P

mpirun -np 4 ./ij_mm -n 256 256 128 -P 2 2 1  -7pt -verify 1 -rep 10 -rap2 0 -job 4 > benchmark_spgemm.out.29
mpirun -np 4 ./ij_mm -n 256 256 128 -P 2 2 1 -27pt -verify 1 -rep 10 -rap2 0 -job 4 > benchmark_spgemm.out.30
mpirun -np 4 ./ij_mm -n 2048 2048 1 -P 2 2 1  -5pt -verify 1 -rep 10 -rap2 0 -job 4 > benchmark_spgemm.out.31
mpirun -np 4 ./ij_mm -n 2048 2048 1 -P 2 2 1  -9pt -verify 1 -rep 10 -rap2 0 -job 4 > benchmark_spgemm.out.32

mpirun -np 4 ./ij_mm -n 256 256 128 -P 2 2 1  -7pt -verify 1 -rep 10 -rap2 1 -job 4 > benchmark_spgemm.out.33
mpirun -np 4 ./ij_mm -n 256 256 128 -P 2 2 1 -27pt -verify 1 -rep 10 -rap2 1 -job 4 > benchmark_spgemm.out.34
mpirun -np 4 ./ij_mm -n 2048 2048 1 -P 2 2 1  -5pt -verify 1 -rep 10 -rap2 1 -job 4 > benchmark_spgemm.out.35
mpirun -np 4 ./ij_mm -n 2048 2048 1 -P 2 2 1  -9pt -verify 1 -rep 10 -rap2 1 -job 4 > benchmark_spgemm.out.36

